From 43e3e3d7641a8e1c298b37e6a277612bf0898708 Mon Sep 17 00:00:00 2001 From: Justin Burkett Date: Wed, 14 Nov 2018 09:32:27 -0500 Subject: [PATCH] Fix use of describe-prefix-bindings in which-key-show-standard-help Use describe-prefix-bindings directly if we do not enter through which-key-C-h-dispatch. Fixes #198 --- which-key.el | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/which-key.el b/which-key.el index c62924da823..d901a31173a 100644 --- a/which-key.el +++ b/which-key.el @@ -2193,13 +2193,18 @@ used are reapplied to the new key sequence." "Call the command in `which-key--prefix-help-cmd-backup'. Usually this is `describe-prefix-bindings'." (interactive) - (let ((which-key-inhibit t)) + (let ((which-key-inhibit t) + (popup-showing (which-key--popup-showing-p))) (which-key--hide-popup-ignore-command) - (cond ((eq which-key--prefix-help-cmd-backup - 'describe-prefix-bindings) - ;; This is essentially what `describe-prefix-bindings' does - (describe-bindings - (kbd (which-key--current-key-string)))) + (cond ((and (eq which-key--prefix-help-cmd-backup + 'describe-prefix-bindings) + ;; If the popup is not showing, we call + ;; `describe-prefix-bindings' directly. + popup-showing) + ;; This is essentially what `describe-prefix-bindings' does. We can't + ;; use this function directly, because the prefix will not be correct + ;; when we enter using `which-key-C-h-dispatch'. + (describe-bindings (kbd (which-key--current-key-string)))) ((functionp which-key--prefix-help-cmd-backup) (funcall which-key--prefix-help-cmd-backup))))) -- 2.30.2